// SCENARIO SCRIPT
// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).
// You can create your own states, but you should give all of them numbers greater than
// or equal to 10.

beginscenarioscript;

variables;

body;

// This is the state that is called every time the scenario is loaded,
// even when a save file in the scenario is loaded. Some things that should go here:
//    Names and descriptions of special items.
//    Names and effects of custom special abilities.
beginstate LOAD_SCEN_STATE;
	set_creature_type_level(228,19);
	init_quest(0,"Find alchemy book.","Balu has lost a book he needs for his new potion.  It's somewhere in his study.");
	init_quest(1,"Find potion ingredients.","Balu is searching for the following things for his new potion: spider glands, asptongue, and caterpillars.");
	init_quest(2,"Explore Cave of No Return.","Mayor Dumed told you that it is in the north, past the Giant's Forest.  He has little faith that you will survive the journey, though.");
	init_special_item(0,"Caterpillars","A bunch of fuzzy caterpillars.  They are very oddly colored.");
	init_special_item(1,"Spider Glands","The poison glands of a swamp spider.  The poison within can be quite deadly.");
	init_special_item(2,"Asptongue","The tongue of an asp, a rare and useful alchemical ingredient.");
break;

// This is the state that is called only once at the very beginning of 
// the scenario. Some things that should go here:
//    The stuff in shops.
//    Creating horses and boats.
beginstate START_SCEN_STATE;
	// Initialize a few shops.
	
	// Shop 0 - Smith's Smithy
	add_item_to_shop(0,25,10);
	add_item_to_shop(0,26,2);
	add_item_to_shop(0,30,2);
	add_item_to_shop(0,31,2);
	add_item_to_shop(0,35,1);
	add_item_to_shop(0,45,5);
	add_item_to_shop(0,46,2);
	add_item_to_shop(0,50,5);
	add_item_to_shop(0,51,2);
	add_item_to_shop(0,55,5);
	add_item_to_shop(0,65,5);
	add_item_to_shop(0,121,10);
	add_item_to_shop(0,122,1);
	add_item_to_shop(0,126,5);
	add_item_to_shop(0,131,1);
	add_item_to_shop(0,141,1);
	
	// Shop 1 - Balu's Magic and Alchemy
	add_item_to_shop(1,2000,2);
	add_item_to_shop(1,2001,2);
	add_item_to_shop(1,2002,1);
	add_item_to_shop(1,2003,1);
	add_item_to_shop(1,2004,1);
	add_item_to_shop(1,2005,1);
	add_item_to_shop(1,2006,1);
	add_item_to_shop(1,2007,1);
	add_item_to_shop(1,3000,2);
	add_item_to_shop(1,3001,2);
	add_item_to_shop(1,3002,1);
	add_item_to_shop(1,3003,1);
	add_item_to_shop(1,3004,1);
	add_item_to_shop(1,3005,1);
	add_item_to_shop(1,3006,1);
	add_item_to_shop(1,4002,1);
	add_item_to_shop(1,4003,1);
	
	// Shop 2 - Parry's Paraphernalia
	add_item_to_shop(2,111,500);
	add_item_to_shop(2,114,500);
	add_item_to_shop(2,170,500);
	add_item_to_shop(2,171,500);
	add_item_to_shop(2,172,30);
	add_item_to_shop(2,174,500);
	add_item_to_shop(2,177,500);
	add_item_to_shop(2,214,2);
	add_item_to_shop(2,244,1);
	add_item_to_shop(2,136,3);
	add_item_to_shop(2,137,1);
	add_item_to_shop(2,220,1);
	add_item_to_shop(2,223,2);
	
	// Shop 3 - Bubba's Projectiles
	add_item_to_shop(3,85,500);
	add_item_to_shop(3,86,10);
	add_item_to_shop(3,90,10);
	add_item_to_shop(3,95,3);
	add_item_to_shop(3,100,500);
	add_item_to_shop(3,101,10);
	add_item_to_shop(3,105,500);

	// Shop 4 - unused

	// Shop 5 - Farmer's Market (food)
	add_item_to_shop(5,4,500);
	add_item_to_shop(5,6,500);
	add_item_to_shop(5,7,500);
break;

// This state is called every tick wherever the party is in the scenario.
// You can use the set_state
beginstate START_STATE;

break;

// "Alchemy and Whatnot" book ability script
beginstate 10;
	message_dialog("Once past the table of contents, you are confronted by masses of alchemical jargon.  There are numerous long-winded explanations as to how one makes a healing potion or a curing potion.  Unfortunately, that's all this book covers.","At the end you find the author's notes.  It says, _Even more exciting recipes are covered in my next books, 'Good Graymold!', and the best-selling 'Asptongue for Aspiring Alchemists'._");
break;

beginstate 11;	// "Hellspawn and You" ability
	message_dialog("This is a self-help book for summoning the beasts of the netherworld.  It includes many tips about stopping your summoned creatures from slaughtering you, mentioning many times not to annoy them.","An excerpt: _Hellspawn are intelligent beings.  And like most intelligent life, they have feelings.  Don't hurt their feelings, or they may hurt your spine a lot more.  Insults and the like are not recommended for keeping your demon in line._");
break;